<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/firstdemo/CSS/w3.css">
<link rel="stylesheet" href="/firstdemo/CSS/google.css">
<link rel="stylesheet" href="/firstdemo/fontawesome/css/all.css">
<style>
    html,body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif}
</style>

<head>
    <base href="<%=basePath%>">
    <title>留言页面</title>
</head>

<body class="w3-light-grey">

<div class="w3-bar w3-top w3-teal w3-large" style="z-index:4">
    <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i>  Menu</button>
    <span class="w3-bar-item w3-right">Logo</span>
</div>

<!-- Sidebar/menu -->
<nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;" id="mySidebar"><br>
    <div class="w3-container w3-row">
        <div class="w3-col s4">
            <img src="/firstdemo/images/avatar2.png" class="w3-circle w3-margin-right" style="width:46px">
        </div>
        <div class="w3-col s8 w3-bar">
            <span>Welcome ${username}</span><br>
            <a  class="w3-bar-item w3-button"><i class="fa fa-envelope"></i></a>
            <a  class="w3-bar-item w3-button"><i class="fa fa-user"></i></a>
            <a  class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a>
        </div>
    </div>
    <hr>
    <div class="w3-container">
        <h5>Dashboard</h5>
    </div>
    <div class="w3-bar-block">
        <a  class="w3-bar-item w3-button w3-padding-16 w3-hide-large w3-dark-grey w3-hover-black" onclick="w3_close()" title="close menu"><i class="fa fa-remove fa-fw"></i>  Close Menu</a>

        <a  class="w3-bar-item w3-button w3-padding" id="friendbar"><i class="far fa-gem"></i>
              <botton id = "friend">留言板</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="historybar" href="BacktoLogin" ><i class="fa fa-history fa-fw"></i>
              退出用户</a>

    </div>
</nav>


<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>

<!-- !PAGE CONTENT! -->
<div class="w3-main" style="margin-left:300px;margin-top:43px;">

    <!-- Header -->
    <header class="w3-container" style="padding-top:22px">
        <h5><b><i class="fa fa-dashboard"></i> My Dashboard</b></h5>
    </header>

    <!-- $# user lists friend -->
    <div id = "alter5" class="w3-container">
        <div class="w3-row-padding" style="margin:0 -16px">
            <div class="w3-quarter">
                <img src="/firstdemo/images/region.jpg" style="width:100%" alt="Google Regional Map">
            </div>
            <div class="w3-threequarter">

                <div id="app">
                    ${receivername}的留言板
                    <table  class="w3-table w3-striped w3-white" >
                        <tr>
                            <th>留言者</th>
                            <th>内容</th>
                        </tr>
                        <c:forEach var="U" items="${Message}"  >

                                <tr>
                                    <td><p type="text" value="${U.delivername}" name="delivername">${U.delivername}</p></td>
                                    <td><p type="text" value="${U.string}" name="string">${U.string}</p></td>
                                    <input type="hidden" value="${U.id}" name="id" style = "display: none"></td>
                                    <input type="hidden" value=${username} name="username"><br><br>
                                </tr>

                        </c:forEach>
                    </table>
                </div>
            </div>
        </div>

    </div>
    <hr>

    <!-- $# show page list -->
    <div id = "alter7" class="w3-container w3-dark-grey w3-padding-32">
        <div class="w3-row">
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-green">Demographic</h5>
                <p>Language</p>
                <p>Country</p>
                <p>City</p>
            </div>
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-red">System</h5>
                <p>Browser</p>
                <p>OS</p>
                <p>More</p>
            </div>
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-orange">Target</h5>
                <p>Users</p>
                <p>Active</p>
                <p>Geo</p>
                <p>Interests</p>
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer class="w3-container w3-padding-16 w3-light-grey">
        <h4>FOOTER</h4>
        <p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css + BUAA</a></p>
    </footer>

    <!-- End page content -->
</div>

<script>
    // Get the Sidebar
    var mySidebar = document.getElementById("mySidebar");

    // Get the DIV with overlay effect
    var overlayBg = document.getElementById("myOverlay");

    // Toggle between showing and hiding the sidebar, and add overlay effect
    function w3_open() {
        if (mySidebar.style.display === 'block') {
            mySidebar.style.display = 'none';
            overlayBg.style.display = "none";
        } else {
            mySidebar.style.display = 'block';
            overlayBg.style.display = "block";
        }
    }

    // Close the sidebar with the close button
    function w3_close() {
        mySidebar.style.display = "none";
        overlayBg.style.display = "none";
    }

    var b5 = document.getElementById("friend");

    function display(id){
        var traget=document.getElementById(id);
        if(traget.style.display==="none"){
            traget.style.display="block";
        }else{
            ;
        }
    }

    function hide(id){
        var traget=document.getElementById(id);
        if(traget.style.display==="none"){
            ;
        }else{
            traget.style.display="none";
        }
    }

    function activebar(id){
        var obj = document.getElementById(id);
        obj.className += ' w3-blue';
    }

    function negtivebar(id){
        var obj = document.getElementById(id);
        obj.className = "w3-bar-item w3-button w3-padding";
    }

    window.onload = function (){
        display("alter5");
        activebar("friendbar");
    }
</script>

</body>
</html>
<!------------------------------------------------------------------------------------>


